package com.rookie.rabbit.modular.enums;

import com.rabbitmq.client.BuiltinExchangeType;
import com.rookie.rabbit.modular.util.RabbitUtils;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author rookie
 */
@Getter
@AllArgsConstructor
public enum ExchangeEnum {

    /**
     * 交换器列表
     */
    DEFAULT_EXCHANGE("默认交换器",null,null,null,null,null,null);

    /**
     * 描述
     */
    private String digest;

    /**
     * 1:direct
     * 2:Fanout
     * 3、topic
     * 默认是 DIRECT
     */
    private BuiltinExchangeType exchangeType;

    /**
     * 交换器名称
     */
    private String name;

    /**
     * bean名称
     */
    private String beanName;

    /**
     * 是否是延时交换器 默认是 0
     */
    private Integer isDelayExchange;

    /**
     * 是否持久化 默认是 1
     */
    private Integer durable;

    /**
     * 是否自动删除 默认是 0
     */
    private Integer autoDelete;

    public String getName(){
        return RabbitUtils.getDefaultExchangeName(this,this.name);
    }
}
